﻿namespace Mockingbird.Core.Models
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.Security.Cryptography;
    using MongoDB.Bson;

    public class UserPropertiesModel
    {
        private List<ObjectId> _friends;

        public ObjectId Id { get; set; }

        public string Avatar { get; set; }

        [RegularExpression(@"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}")]
        [Required(ErrorMessage = "This Field is required")]
        public string Email { get; set; }

        [Display(Name = "Password")]
        [Required(ErrorMessage = "This Field is required")]
        public string Password { get; set; }

        [Display(Name = "Name")]
        [Required(ErrorMessage = "This Field is required")]
        public string Name { get; set; }

        public DateTime RegistryDate { get; set; }

        public List<ObjectId> Friends
        {
            get { return _friends ?? (_friends = new List<ObjectId>()); }
            set { _friends = value; }
        }
    }
}
